﻿function check_all(check) {
    var flag = false;
    if (check.checked == true) {
        flag = true;
    }
    else {
        flag = false
    }

    var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
    for (var x = 0; x < c.length; x++) {
        if (c[x].type + '' == 'checkbox' && (c[x].id.indexOf('chkSelect') != -1)) {
            c[x].checked = flag
        }
    }

}